//
//  UIButton+Extension.h
//  TableDemo
//
//  Created by jutuo on 2020/3/29.
//  Copyright © 2020 jutuo. All rights reserved.
//


#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, UIButtonTitleImageRelativePosition) {
    UIButtonDefault = 0,
    OnlyTitle,
    OnlyImage,
    TitleLeftImageRight,
    ImageLeftTitleRight,
    TitleTopImageBottom,
    ImageTopTitleBottom,
};

typedef NS_ENUM(NSInteger, UIButtonContentAlignmentType) {
    AlignmentTypeNone,
    AlignmentTypeLeft = 1,
    AlignmentTypeRight = 1 << 1,
    AlignmentTypeTop = 1 << 2,
    AlignmentTypeBottom = 1 << 3,
    AlignmentTypeStrut = 1 << 4, //撑开模式 不参与其他对齐模式
};
@interface UIButton (Extension)
@property (nonatomic, assign) UIButtonTitleImageRelativePosition positionType;
@property (nonatomic, assign) CGFloat space;
@property (nonatomic, strong) NSString *titleText;
@property (nonatomic, strong) NSString *imgName;
@property (nonatomic, strong) UIFont *titleFont;

@property (nonatomic, assign) UIButtonContentAlignmentType aliginment;
@property (nonatomic, assign) CGFloat hPadding;
@property (nonatomic, assign) CGFloat vPadding;
/**
 * ltPadding 撑开模式下起作用
 * left Or Top Padding
 */
@property (nonatomic, assign) CGFloat ltPadding;
/**
 * rbPadding 撑开模式下起作用
 * right Or Bottom Padding
 */
@property (nonatomic, assign) CGFloat rbPadding;

@property (nonatomic, assign) NSInteger timeOut;

- (void)setBackgroundColor:(UIColor *)backgroundColor forState:(UIControlState)state;

- (void)setBorderColor:(UIColor *)color forState:(UIControlState)state;

- (void)setBorderWidth:(CGFloat)borderWidth forState:(UIControlState)state;

- (void)setAnimationImages:(NSArray<UIImage *> *)animationImages animationDuration:(NSTimeInterval)animationDuration;
/**
 *  验证码倒计时
 */
- (void)verifedCodeButtonWithTitle:(NSString *_Nullable)title andNewTitle:(NSString *_Nullable)newTitle titleColor:(UIColor * _Nullable)titleColor  newTitleColor:(UIColor * _Nullable)newTitleColor bgColor:(UIColor * _Nullable)bgColor newBgColor:(UIColor *_Nullable)newBgColor;

@end


@interface UIButton (XDClickInterval)
@property (nonatomic, assign) NSTimeInterval acceptEventInterval;//重复点击的间隔
@end
NS_ASSUME_NONNULL_END
